{% extends "shop/base.html" %}
{% comment %}
-------------------------------------------------------------------
This is the base product detail page.
To modify the templates of specific types of products, such as
ProductVariations or CustomProducts, look for product/detail_xxx.html
-------------------------------------------------------------------
{% endcomment %}
{% load i18n %}
{% load thumbnail %}
{% load satchmo_price %}
{% load satchmo_currency satchmo_category %}
{% load satchmo_util satchmo_discounts %}
{% load app_plugins %}
{% load satchmo_tuning_category %}

{% block extra-head %}
{% if product.meta %}
    <meta name="description" content="{{product.meta}}">
{% endif %}
{% endblock %}

{% block navbar %}
<li class="first"><a href="/">{% trans "Home" %}</a></li>
{% for name, url in product.category.all.0.get_url_name %}
    <li><a href="{{ url }}">{{ name }}</a></li>
{% endfor %}
<li>{{ product.translated_name }}</li>
{% endblock %}

{% block sidebar-categories %}
    <div id="menu_container">
    {% if product.get_category %}
        {% sibling_category_tree product.get_category.id %}
    {% else %}
        {% category_tree %}
    {% endif %}
    </div>
{% endblock %}

{% block content %}
{% block productdetail %}
<h4>{{ product.translated_name }}</h4>
<p>{{ product.translated_description }}</p>
{% trans "Price" %} {% if default_view_tax %} {% trans '(incl. tax)' %}{% endif %}:
<h3>
	{% if sale %}<strike id="fullprice" style="display: block;">{{ product|discount_price:""|currency }}</strike>{% endif %}
	<span id="price">{{ product|discount_price:sale|currency }}</span>
</h3>
{% for pic in product.productimage_set.all %}
    {% thumbnail pic.picture 280x280 as image %}
    <img src="{{ image }}" width="{{ image.width }}" height="{{ image.height }}" />
{% endfor %}

{% if error_message %}<p><strong>{{ error_message }}</strong></p>{% endif %}
<form id="options" action="{% url satchmo_smart_add %}" method="post">
{% trans "Quantity" %} <input type="text" size="5" name="quantity" id="quantity" value="1" class="priced" />
<input type="hidden" name="productname" id="productname" value="{{product.slug}}" />
<input type="submit" name="addcart" value="{% trans "Add to cart" %}" />
{% plugin_point "product_add_buttons" %}
{% plugin_point "product_form" %}
</form>
{% endblock %}

{% block productfooter %}
{% if sale %}{% include "product/product_discount_eligible.html" %}{% endif %}
{% plugin_point "product_footer" %}
{% endblock %}
{% endblock %}
